<template>
  <div class="topNav">
    <div class="topleft">
      <svg class="icon" aria-hidden="true">
        <use xlink:href="#icon-liebiao2"></use>
      </svg>
    </div>

    <div class="topContent" v-for="(item,index) in list" :key="index">
      
      <span :class="index==num ? 'active':''" @click="tap(index)">{{item}}</span>

    </div>
   
    <div class="topRight">
      <svg class="icon" aria-hidden="true" @click="$router.push('/search')">
        <use xlink:href="#icon-sousuoxiao"></use>
      </svg>
    </div>
  </div>
  
</template>

<script>
export default {
    name:'TopNav',
    data() {
      return {
        num:1,
        list:["我的","发现","云村","视频"]      
      }
    },
    // computed:{
    //   num(){
    //     return 
    //   }
    // }
    methods: {
      tap(e){
        this.num = e
      }
      
    },
}
</script>

<style lang="less" scoped>
    .topNav{
        width: 100%;
        height: 1rem;
        padding: .2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .topContent{
            width: 65%;
            height: 100%;
            display: flex;
            justify-content: space-around;
            // align-items: center;
            font-size: .36rem;
            .active{
                font-weight: 900;
            }
        }
    }
</style>